/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 80027
 Source Host           : localhost:3306
 Source Schema         : kwshare-user

 Target Server Type    : MySQL
 Target Server Version : 80027
 File Encoding         : 65001

 Date: 15/01/2022 18:50:33
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单id',
  `name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
  `parent_id` bigint DEFAULT NULL COMMENT '父菜单id',
  `path` varchar(255) DEFAULT NULL COMMENT '路由地址',
  `component` varchar(255) DEFAULT NULL COMMENT '组件地址',
  `redirect` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '重定向地址',
  `visible` char(1) DEFAULT NULL COMMENT '菜单状态（0显示 1隐藏）',
  `icon` varchar(255) DEFAULT NULL COMMENT '菜单图标',
  `sort` int DEFAULT NULL COMMENT '排序',
  `del_flag` int DEFAULT NULL COMMENT '是否删除',
  `create_by` varchar(64) DEFAULT NULL COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of menu
-- ----------------------------
BEGIN;
INSERT INTO `menu` VALUES (1, '系统管理', 0, '/system', 'Layout', '/system/user', '0', 'el-icon-setting', 1, 0, 'admin', '2022-01-08 16:38:12', 'admin', '2022-01-08 16:38:25');
INSERT INTO `menu` VALUES (2, '日志管理', 0, '/log', 'Layout', '/log/operlog', '0', 'el-icon-document', 2, 0, 'admin', '2022-01-08 16:39:36', 'admin', '2022-01-08 16:39:45');
INSERT INTO `menu` VALUES (100, '用户管理', 1, 'user', 'user/index', '', '0', 'el-icon-user', 1, 0, 'admin', '2022-01-08 16:44:53', 'admin', '2022-01-08 16:45:03');
INSERT INTO `menu` VALUES (101, '角色管理', 1, 'role', 'role/index', NULL, '0', 'el-icon-s-custom', 2, 0, 'admin', '2022-01-08 16:48:15', 'admin', '2022-01-08 16:48:23');
INSERT INTO `menu` VALUES (102, '菜单管理', 1, 'menu', 'menu/index', NULL, '0', 'el-icon-menu', 3, 0, 'admin', '2022-01-08 16:49:23', 'admin', '2022-01-08 16:49:29');
INSERT INTO `menu` VALUES (103, '操作日志', 2, 'operlog', 'operlog/index', NULL, '0', 'el-icon-thumb', 1, 0, 'admin', '2022-01-08 16:50:48', 'admin', '2022-01-08 16:50:56');
INSERT INTO `menu` VALUES (104, '登录日志', 2, 'logininfo', 'logininfor/index', NULL, '0', 'el-icon-view', 2, 0, 'admin', '2022-01-08 16:51:49', 'admin', '2022-01-08 16:51:55');
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_name` varchar(50) DEFAULT NULL COMMENT '角色名称',
  `role_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '描述',
  `sort` int DEFAULT NULL COMMENT '排序',
  `del_flag` int DEFAULT '0' COMMENT '删除标志：0存在/2删除',
  `create_by` varchar(50) DEFAULT NULL COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, '超级管理员', '超级管理员。有权查看所有页面。', NULL, 0, 'admin', '2022-01-01 00:03:10', 'admin', '2022-01-15 18:15:11');
INSERT INTO `role` VALUES (2, '普通用户', '普通用户。可以查看除权限页以外的页面。', NULL, 0, 'admin', '2022-01-01 00:03:21', 'admin', '2022-01-15 18:11:55');
COMMIT;

-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_id` bigint DEFAULT NULL COMMENT '角色id',
  `menu_id` bigint DEFAULT NULL COMMENT '菜单id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of role_menu
-- ----------------------------
BEGIN;
INSERT INTO `role_menu` VALUES (1, 1, 1);
INSERT INTO `role_menu` VALUES (2, 1, 2);
INSERT INTO `role_menu` VALUES (8, 2, 1);
INSERT INTO `role_menu` VALUES (9, 2, 2);
INSERT INTO `role_menu` VALUES (68, 2, 1);
INSERT INTO `role_menu` VALUES (72, 2, 2);
INSERT INTO `role_menu` VALUES (75, 1, 1);
INSERT INTO `role_menu` VALUES (80, 1, 1);
INSERT INTO `role_menu` VALUES (84, 1, 1);
INSERT INTO `role_menu` VALUES (88, 1, 2);
INSERT INTO `role_menu` VALUES (93, 1, 2);
INSERT INTO `role_menu` VALUES (96, 1, 1);
INSERT INTO `role_menu` VALUES (100, 1, 2);
INSERT INTO `role_menu` VALUES (103, 2, 101);
INSERT INTO `role_menu` VALUES (104, 2, 2);
INSERT INTO `role_menu` VALUES (105, 2, 103);
INSERT INTO `role_menu` VALUES (106, 2, 104);
INSERT INTO `role_menu` VALUES (108, 1, 2);
INSERT INTO `role_menu` VALUES (111, 1, 1);
INSERT INTO `role_menu` VALUES (115, 1, 2);
INSERT INTO `role_menu` VALUES (120, 1, 2);
INSERT INTO `role_menu` VALUES (123, 1, 1);
INSERT INTO `role_menu` VALUES (124, 1, 100);
INSERT INTO `role_menu` VALUES (125, 1, 101);
INSERT INTO `role_menu` VALUES (126, 1, 102);
INSERT INTO `role_menu` VALUES (127, 1, 2);
INSERT INTO `role_menu` VALUES (128, 1, 103);
INSERT INTO `role_menu` VALUES (129, 1, 104);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `username` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '账号',
  `password` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码',
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '姓名',
  `sex` varchar(5) DEFAULT NULL COMMENT '性别',
  `phone` varchar(20) DEFAULT NULL COMMENT '电话',
  `email` varchar(50) DEFAULT NULL COMMENT '邮件',
  `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '头像',
  `sort` int DEFAULT NULL COMMENT '排序',
  `del_flag` int DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'admin', 'admin', '超级管理员', '男', '18585679538', '1475654312@qq.com', 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', 1, 0, 'admin', '2021-12-19 16:53:27', 'admin', '2022-01-05 21:05:05');
INSERT INTO `user` VALUES (2, 'yangjing', 'yangjing', '杨静', '男', '18585679538', '1475654312@qq.com', 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', 2, 0, 'admin', '2021-12-26 22:44:48', 'yangjing', '2022-01-08 10:35:09');
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint DEFAULT NULL COMMENT '用户id',
  `role_id` bigint DEFAULT NULL COMMENT '角色id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES (1, 1, 1);
INSERT INTO `user_role` VALUES (2, 2, 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
